Skip to main content

yLabel

Picture of y-Label

Description

The yLabel component serves as a powerful tool primarily designed for displaying short text information within your application. It's an adaptable element that allows both static and dynamic content.

With the yLabel you can display user instructions, show real-time data updates, provide context for other components, or present calculated values within a form, among other applications.

Some uses for the yLabel are:

tip

Use yTextarea or yTextbox for handling longer texts.

Basic Structure

In the following the basic structure of the yLabel shall be explained. For the general structure of a yComponent please visit the YBase-components basic-structure.

BasicStructure

Properties

Through its various properties the yLabel can be configured to suit your needs. The display below provides you with an overview of all the yLabel properties.

Properties can be changed directly through three methods:

  • Inside the Toolbar, which is positioned in your workarea next to your component where you need it. It shows the most important properties, thus providing a fast and efficient way to configure your component in the most basic way.
  • It may also occur in the Toolbar Extension, which is a seamless extension accesible as a dropdown item of the Toolbar. It extends the functionality of the Toolbar by providing advanced pickers for most used properties.
  • Inside the Detail Panel, which is located in the righthand drawer. Every property of a component can be configured here.
METAread more
--y-label__component-id

The identifier of the component that is unique within a page.

--y-label__component-type

The type of the component. For this component it is -label.

--y-label__name

The custom name of the component. It serves for better identification of the component.

--y-label__version

The custom version of the Label-component. This can be used to ensure that all components work well together.

--y-label__core-theme

The CoreTheme, which will be apllied to the Label. For further information on themes visit the themes page.

--y-label__sub-theme

The subtheme subordinated to the previously specified CoreTheme, which will be apllied to the Label. For further information on themes visit the themes page.

--y-label__group-theme

The group theme is a further variation of the subtheme which is specified especially for variations of a component inside the subtheme. For further information on themes visit the Theme-Manager page.

DISPLAYread more
--y-label__display

This property specifies the display behavior of the component. This can be be set to:

  • none
  • block
  • flex
  • inline
--y-label__position

This property specifies the type of positioning method used for the component. This can be be set to:

  • static
  • relative
  • absolute
  • sticky
  • fixed
--y-label__visible

This property can toggle the visibility of the component. The two modes are completely hidden and fully shown.

SIZEread more
--y-label__min-width

The minimum value for the width of the component. This can be set in:

  • px
  • pt
  • em
  • vw
  • vh
  • %
--y-label__min-height

The minimum value for the height of the component. This can be set in:

  • px
  • pt
  • em
  • vw
  • vh
  • %

The value for the width of the component. This can be set in:

  • px
  • pt
  • em
  • vw
  • vh
  • %
  • auto

The value for the height of the component. This can be set in:

  • px
  • pt
  • em
  • vw
  • vh
  • %
  • auto
--y-label__max-width

The maximum value for the width of the component. This can be set in:

  • px
  • pt
  • em
  • vw
  • vh
  • %
  • none
--y-label__max-height

The maximum value for the height of the component. This can be set in:

  • px
  • pt
  • em
  • vw
  • vh
  • %
  • none
--y-label__flex

The flex property sets the length on flexible items. This sets the value in n-fold shares extrapolated to all other components with the flex display within the same container.

PLACEMENTread more
--y-label__margin-top

This property creates a space around the component, outside of the top border. This can be set in percent or pixels.

--y-label__margin-right

This property creates a space around the component, outside of the right border. This can be set in percent or pixels.

--y-label__margin-bottom

This property creates a space around the component, outside of the bottom border. This can be set in percent or pixels.

--y-label__margin-left

This property creates a space around the component, outside of the left border. This can be set in percent or pixels.

--y-label__padding-top

This property creates a space within the component, inside of the top border. This can be set in percent or pixels.

--y-label__padding-right

This property creates a space within the component, inside of the right border. This can be set in percent or pixels.

--y-label__padding-bottom

This property creates a space within the component, inside of the bottom border. This can be set in percent or pixels.

--y-label__padding-left

This property creates a space within the component, inside of the top border. This can be set in percent or pixels.

Usage

In this section you'll find a collection of application scenarios and examples that illustrate how to leverage the yLabel in ways that deviate from its standard behavior, as defined by yBase. This section aims to inspire and guide you through various possibilities, helping you to implement more complex or unique functionalities tailored to your specific needs. General properties that are universally applicable can be found in the yBase usage section.

Variations

Label Elevated
Label Flat
Label Outlined
Label Rounded
Label Plain
genericsizeminWidth95px
stylebackgroundbgColor__normal#44ddbb
styleshadowboxShadow__normal0 3px 6px 0 rgba(16, 18, 24, 0.2)
styleborderborderRadius8px
stylelabellabel__fontColor__normal#FFFFFF

Linking input elements

You can establish a connection between the yLabel component and another component using a SourceLink Picker. In this example, the yLabel component is linked to a yInput component. Whenever the value in the yInput is changed, the connected yLabel component will update accordingly.

How to:

  1. Open the Detail Panel and go to the "Links" tab to open the "Label" section.
  2. Using the SourceLink Picker, select the previously created yInput.

That's it! You can now test this functionality by entering the preview mode and typing text in the yInput component. The yLabel component should update accordingly.

Label Input SourceLink
info

If you want to include text before or after the input value, you can add it in the "Style" > "Label" > "Label" property of the yLabel component. To display the input value, use {value} as a placeholder.

Label Template Result

Displaying table data

You can also establish a connection between the yLabel component and the yTable using a SourceLink Picker. In this example, the yLabel component is linked to specific column of the yTable. Whenever the selected row changes, the connected yLabel component will update accordingly.

How to:

  1. Create a yTable in your application.
  2. Open the Detail Panel of the yLabel and navigate to "Links" to unfold the "Label" group. Now, there are two options:
    1. Using the SourceLink Picker, select the previously created yTable and select a specific row in "Collection/Buffer Property".
    2. Using the SourceLink Picker, select the previously created yTable, leave the "Collection/Buffer Property" empty.
  3. Change the "Style" > "Label" > "Label" Property. Here, you also have the option to include custom text in the message: "Hello {value}!".

Now, in the preview mode, when you click on a row in the yTable, the yLabel component will update accordingly.

Label Table SourceLink